<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
 <script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
	<script type="text/javascript">
	$(function(){
		$.yinchang();
		$("#questiontype").change(function(){
			var questiontype=$("#questiontype").val();
			if(questiontype==1){
				$(".A").show();
			}else if(questiontype==2){
				$(".A").hide();
			}
		})
	$("#addcst").validate({
		 rules:{ 
		questionName: "required",
			qselectA: "required",
			qselectB: "required",
			qselectC: "required",
			qselectD: "required",
			anws:"required"
		 },
		messages :{
			questionName: "请输入问题",
			qselectA: "请填入选项A",
			qselectB: "请填入选项B",
			qselectC: "请填入选项C",
			qselectD: "请填入选项D",
			anws:"请输入参考答案"
		   }
		
	});
		});
		jQuery.extend({
		yinchang:function(){
			var questiontype=$("#questiontype").val()
			if(questiontype==2){
				$(".A").hide();
			}
		}
	});
	</script>
	<style>
	.error{
	color:red;
}
</style>
</head>
<body>
<link href="../css/four.css" rel="stylesheet" type="text/css" />
	<!-- 包含等待框 -->
	<form action="upcst.do" method="post" id="addcst">
	<input type="hidden" name ="qid" value="${question.qid}">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr valign="top">
			<td bgcolor="#FFFFFF">
			    <table width="96%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
					<tr align="center">
						<td align="center" bgcolor="#ebf0f7">试题问题</td>
						<td align="left" bgcolor="#FFFFFF"><input name="questionName" value="${question.questionName}"></td> 
					</tr>
					<tr align="center">
						<td align="center" bgcolor="#ebf0f7">试题类型</td>
						<td align="left" bgcolor="#FFFFFF">
						<select name="questiontype" id="questiontype" >
						<option ${question.questiontype==1?"selected='selected'":""}  value="1" >选择题</option>
						<option ${question.questiontype==2?"selected='selected'":""}  value="2" >简答题</option>
						</select>
						</td> 
					</tr>
					
					
					<tr align="center" class="A" >
						<td align="center" bgcolor="#ebf0f7" >选择题备选A</td>
						<td align="left" bgcolor="#FFFFFF"><input name="qselectA"  value="${question.qselectA}"> </td> 
					</tr>
					<tr align="center" class="A" >
						<td align="center" bgcolor="#ebf0f7">选择题备选B</td>
						<td align="left" bgcolor="#FFFFFF"><input name="qselectB" value="${question.qselectB}"></td>
					</tr>
					<tr align="center" class="A">
						<td align="center" bgcolor="#ebf0f7">选择题备选C</td>
						<td align="left" bgcolor="#FFFFFF"><input name="qselectC" value="${question.qselectC}"> </td>
					</tr>
	
					<tr align="center" class="A">
						<td align="center" bgcolor="#ebf0f7">选择题备选D</td>
						<td align="left" bgcolor="#FFFFFF"><input name="qselectD" value="${question.qselectD}"></td> 
					</tr>
					
					<tr align="center">
						<td align="center" bgcolor="#ebf0f7">难度等级：</td>
						<td align="left" bgcolor="#FFFFFF">
						<select name="hard">
						<option value="1" ${question.hard==1?"selected='selected'":""}>简单</option>
						<option value="2" ${question.hard==2?"selected='selected'":""}>较难</option>
						<option value="3" ${question.hard==3?"selected='selected'":""}>困难</option>
						</select>
						</td> 
					</tr>
					<tr align="center">
						<td align="center" bgcolor="#ebf0f7">模块：</td>
						<td align="left" bgcolor="#FFFFFF">
						<select name="kcmdelid">
						<c:forEach items="${listcour}" var="lc">
						<option ${question.kcmdelid==lc.kcmdelid?"selected='selected'":""} value="${lc.kcmdelid}">${lc.kcmdelName}</option>
						</c:forEach>
						</select>
						</td> 
					</tr>
					<tr align="center">
						<td align="center" bgcolor="#ebf0f7">参考答案</td>
						<td align="left" bgcolor="#FFFFFF"><textarea rows="2" cols="60" name="anws">${question.anws}</textarea></td>> </td> 
					</tr>
				</table>
			</td>
		</tr>
		<tr>
		  <td align="center">  <input type="submit" value="修改" > &nbsp;&nbsp;&nbsp; <input type="button" onclick="javascript:history.go(-1)" value="返回">    </td>
		</tr>
	</table>
  </form>
  <div id="result"></div>
</body>

</html>